package com.neouton.crm.payRecords.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.neouton.common.util.PageUtil;
import com.neouton.crm.cm.entity.SalesCostMigrateVO;
import com.neouton.crm.entity.SysUserEntity;
import com.neouton.crm.payRecords.entity.PaymentRecords;
import com.neouton.crm.payRecords.entity.PaymentRequest;
import com.neouton.crm.payRecords.entity.PaymentTable;
import com.neouton.crm.pm.entity.SalesProjectManageVO;
import com.neouton.crm.receiptRecords.entity.ReceiptTable;
import com.neouton.crm.sales.entity.SalesFileRelationVO;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
* @author Mose
* @description 针对表【payment_records(付款记录)】的数据库操作Service
* @createDate 2023-02-03 15:33:29
*/
public interface PaymentRecordsService  {

    /**
     * 分页查询
     *
     * @param page
     * @param entity
     * @return
     */
    List<PaymentRecords> queryPage(PaymentRecords entity);

    /**
     * 保存或修改付款记录
     * @param entity
     * @param token
     * @return
     */
    PaymentRecords savePaymentRecords(PaymentRecords entity,String token);

    /**
     * 根据主键id更新
     *
     * @param entity
     */
    void updatePaymentRecordsById(PaymentRecords entity);
    /**
     * 查询付款记录
     * @param entity
     * @return
     */
    List<PaymentRecords> queryPayRecordedMoney(PaymentRecords entity);

    PaymentRequest savePaymentRequest(PaymentRequest paymentRequest,String token);

    void updatePaymentRequestById(PaymentRequest entity);
    /**
     * 查询付款申请
     * @param entity
     * @return
     */
    List<PaymentRequest> queryPayRequestMoney(PaymentRequest entity);

    /**
     * 付款申请审批通过
     * @param entity
     * @param token
     * @return
     */
    Boolean approvedPayRequest(PaymentRequest entity,String token,Boolean auto);
    /**
     * 付款申请审批驳回
     * @param entity
     * @param token
     * @return
     */
    Boolean rejectionPayRequest(PaymentRequest entity, String token);
    /**
     * 付款记录审批通过
     * @param entity
     * @param token
     * @return
     */
    Boolean approvedPayRecord(PaymentRecords entity,String token,Boolean auto);
    /**
     * 付款记录审批驳回
     * @param entity
     * @param token
     * @return
     */
    Boolean rejectionPayRecord(PaymentRecords entity, String token);
    /**
     * 根据审批id获取付款申请历史数据
     * @param approvalId
     * @return
     */
    PaymentRequest queryPayRequestHistory(Integer approvalId);
    /**
     * 根据审批id获取付款记录历史数据
     * @param approvalId
     * @return
     */
    PaymentRecords queryPayRecordHistory(Integer approvalId);
    PageUtil<PaymentRequest> queryPaymentRequestListInfo(IPage<PaymentRequest> page, PaymentRequest paymentRequest, List<SysUserEntity> userList, String token);
    List<PaymentRequest> queryPaymentRequestListInfo(PaymentRequest paymentRequest, List<SysUserEntity> userList, String token);
    PageUtil<PaymentRecords> queryPaymentRecordsListInfo(IPage<PaymentRecords> page, PaymentRecords paymentRecords, List<SysUserEntity> userList, String token);
    List<PaymentRecords> queryPaymentRecordsListInfo(PaymentRecords paymentRecords, List<SysUserEntity> userList, String token);
    void exportPaymentRequestInfo(HttpServletResponse response, List<PaymentRequest> list, String token) throws Exception;
    void exportPaymentRecordsInfo(HttpServletResponse response, List<PaymentRecords> list, String token) throws Exception;

    List<PaymentTable> queryPayTablesByIdAndPlanPeriod(PaymentTable entity);


    void updatePayedRecordTableData(Integer approvalId);

    PageUtil<PaymentRecords> queryToDoPaymentRecordsListInfo(IPage<PaymentRecords> page, PaymentRecords paymentRecords, String token);

    PageUtil<PaymentRequest> queryToDoPaymentRequestListInfo(IPage<PaymentRequest> page, PaymentRequest paymentRequest, String token);

    Boolean deletePayedRequestById(Integer payRequestId);

    Boolean deletePayRecordsById(Integer payRecordsId);

 

    void updatePayRequestAfterPass(PaymentRequest paymentRequest, String token);

    PaymentRequest queryReceiptRecordFromCache(int payRequestId, String token);

    void updatePrIsNotById(Integer payRequestId);
}
